package com.sunpy.niohttp.model;

import com.sunpy.niohttp.constant.HTTP_Method;

import javax.validation.constraints.NotEmpty;
import java.util.Arrays;

public class HttpInfo {

    /**
     * uri
     */
    @NotEmpty
    private String uri;

    /**
     * http请求中的method字段
     */
    @NotEmpty
    private String httpMethod = HTTP_Method.GET;

    /**
     * http请求头
     */
    private String[] header;

    /**
     * http请求体
     */
    private Object body;

    public String getHttpMethod() {
        return httpMethod;
    }

    public void setHttpMethod(String httpMethod) {
        this.httpMethod = httpMethod;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public String[] getHeader() {
        return header;
    }

    public void setHeader(String[] header) {
        this.header = header;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "HttpInfo{" +
                "uri='" + uri + '\'' +
                ", httpMethod='" + httpMethod + '\'' +
                ", header=" + Arrays.toString(header) +
                ", body=" + body +
                '}';
    }
}
